# eric7.VCS.StatusMonitorThread

Module implementing the VCS status monitor thread base class.

### Global Attributes

None

### Classes

VcsStatusMonitorThread | Class implementing the VCS status monitor thread base class.

### Functions

None

## VcsStatusMonitorThread

Class implementing the VCS status monitor thread base class.

### Signals

vcsStatusMonitorAllData(dict)
  emitted to signal all VCS status (key is project relative file name, value is status)
vcsStatusMonitorData(list of str)
  emitted to update the VCS status
vcsStatusMonitorInfo(str)
  emitted to signal some info of the monitoring thread
vcsStatusMonitorStatus(str, str)
  emitted to signal the status of the monitoring thread (ok, nok, op) and a status message

### Derived from

QThread

### Class Attributes

None

### Class Methods

None

### Methods

VcsStatusMonitorThread | Constructor
_getInfo | Protected method implementing the real info action.
_performMonitor | Protected method implementing the real monitoring action.
_shutdown | Protected method performing shutdown actions.
checkStatus | Public method to wake up the status monitor thread.
clearCachedState | Public method to clear the cached VCS state of a file/directory.
getAutoUpdate | Public method to retrieve the status of the auto update function.
getInterval | Public method to get the monitor interval.
run | Public method implementing the tasks action.
setAutoUpdate | Public method to enable the auto update function.
setInterval | Public method to change the monitor interval.
stop | Public method to stop the monitor thread.

### Static Methods

None

#### VcsStatusMonitorThread (Constructor)

VcsStatusMonitorThread(interval, project, vcs, parent=None)

Constructor

interval (int)
  new interval in seconds
project (Project)
  reference to the project object
vcs (VersionControl)
  reference to the version control object
parent (QObject)
  reference to the parent object

#### VcsStatusMonitorThread._getInfo

_getInfo()

Protected method implementing the real info action.

This method should be overridden and create a short info message to be shown in the main window status bar right next to the status indicator.

Return:
  short info message

Return Type:
  str

#### VcsStatusMonitorThread._performMonitor

_performMonitor()

Protected method implementing the real monitoring action.

This method must be overridden and populate the statusList member variable with a list of strings giving the status in the first column and the path relative to the project directory starting with the third column. The allowed status flags are:

- "A" path was added but not yet committed
- "M" path has local changes
- "O" path was removed
- "R" path was deleted and then re-added
- "U" path needs an update
- "Z" path contains a conflict
- "?" path is not tracked
- "!" path is missing
- " " path is back at normal

Return:
  tuple of flag indicating successful operation and a status message in case of non successful operation

Return Type:
  tuple of (bool, str)

Raises NotImplementedError:
  to indicate that this method must be implemented by a subclass

#### VcsStatusMonitorThread._shutdown

_shutdown()

Protected method performing shutdown actions.

The default implementation does nothing.

#### VcsStatusMonitorThread.checkStatus

checkStatus()

Public method to wake up the status monitor thread.

#### VcsStatusMonitorThread.clearCachedState

clearCachedState(name)

Public method to clear the cached VCS state of a file/directory.

name (str)
  name of the entry to be cleared

#### VcsStatusMonitorThread.getAutoUpdate

getAutoUpdate()

Public method to retrieve the status of the auto update function.

Return:
  status of the auto update function

Return Type:
  bool

#### VcsStatusMonitorThread.getInterval

getInterval()

Public method to get the monitor interval.

Return:
  interval in seconds

Return Type:
  int

#### VcsStatusMonitorThread.run

run()

Public method implementing the tasks action.

#### VcsStatusMonitorThread.setAutoUpdate

setAutoUpdate(auto)

Public method to enable the auto update function.

auto (bool)
  status of the auto update function

#### VcsStatusMonitorThread.setInterval

setInterval(interval)

Public method to change the monitor interval.

interval (int)
  new interval in seconds

#### VcsStatusMonitorThread.stop

stop()

Public method to stop the monitor thread.

Up